From: Matthias Clasen Date: Fri, 5 Jan 2018 16:09:04 +0000 (-0500) Subject: file button: Don't leak rows X-Git-Tag: archive/raspbian/3.24.39-1+rpi1~1^2~65^2~38^2~71 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=081488f8f2ac608dabde22493f18d99b49d4e70a;p=gtk%2B3.0.git file button: Don't leak rows The file chooser button manually manages the memory of data in its model, so it needs to explicitly free the rows. --- diff --git a/gtk/gtkfilechooserbutton.c b/gtk/gtkfilechooserbutton.c index e5c0225157..42a8abb84e 100644 --- a/gtk/gtkfilechooserbutton.c +++ b/gtk/gtkfilechooserbutton.c @@ -994,8 +994,11 @@ gtk_file_chooser_button_finalize (GObject *object) if (priv->current_folder_while_inactive) g_object_unref (priv->current_folder_while_inactive); - if (priv->model != NULL) - g_object_unref (priv->model); + if (priv->model) + { + model_remove_rows (button, 0, gtk_tree_model_iter_n_children (priv->model, NULL)); + g_object_unref (priv->model); + } G_OBJECT_CLASS (gtk_file_chooser_button_parent_class)->finalize (object); }